import request from '@/utils/request'
import md5 from 'js-md5'

// 用户登录
export function login(form) {
 
  return request({
    url: '/user/login',
    method: 'post',
    data: {
      "username":form.username,
      "password":inputPassToFromPass(form.password),
    }
  })
}

 
 


// 获取用户信息
export function getUserInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

export function do_getpermission() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

 function inputPassToFromPass(inputPass){
 const salt= "1a2b3c4d";
 let str=salt.charAt(0) + salt.charAt(4) + inputPass + salt.charAt(1) + salt.charAt(5);
 console.log(str);
return md5(str)
}